package org.example.alicloud.service;

import org.example.alicloud.model.CommonResult;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

//FeignClient实现服务调用 value：指定调用的服务名称 fallback：指定一个异常处理类处理错误信息
@FeignClient(value = "nacos-payment-provider", fallback = PaymentFallBackService.class, configuration = MyFeignConfiguration.class)
public interface PaymentService {

    /** 声明方法体 与要调用的服务端的方法头一致
     *
     * @param id
     * @return
     */
    @GetMapping(value = "/payment/hash/{id}")
    public CommonResult paymentSQL(@PathVariable("id") Long id);
}
